ELF 			:= test_matrix.elf
BFLAGS   	:= -g -O2 -static -Wall -Wextra -Wpedantic -I./
CXXFLAGS 	:= -x c++ $(BFLAGS) -std=c++20 -Weffc++ -Wno-unused-result
LDFLAGS  	:=

ifneq ($(VERBOSE),1)
	QCXX   = @echo '  c++   '$<;
	QRUN   = @echo '  run   '$<;
	QTEST  = @echo '  test  '$<;
	QCLEAN = @echo '  clean '$<;
endif

all: $(ELF)
	./$(ELF)

.PHONY: clean rebuild
.PRECIOUS: %.elf

%.elf: %.cpp
	$(QCXX)$(CXX) $(CXXFLAGS) $^ $(LDFLAGS) -o $@

clean:
	$(QCLEAN) rm -rf *.elf *.o *.out *.tmp

rebuild: clean all
